package com.yangye.pisystem.controller;

import com.yangye.picommon.model.PiResult;
import com.yangye.pisystem.service.ExcelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

/**
 * @author yangye
 * @date 2019/8/29
 */
@RestController
@RequestMapping("/excel")
public class ExcelController {

	@Autowired
	private ExcelService excelService;

	@RequestMapping("/sort")
	public PiResult ExcelSort(MultipartFile file) throws IOException {
		String url = excelService.handleExcel(file);
		return PiResult.succeed(url);
	}
}
